lexer grammar PL00Lexer;

channels {
	WS_CHANNEL, CM_CHANNEL
}

Break: 'break';

Continue: 'continue';

Const: 'const';

Var: 'var';

Procedure: 'procedure';

Function: 'function';

Call: 'call';

Return: 'return';

Begin: 'begin';

End: 'end';

If: 'if';

Then: 'then';

Else: 'else';

While: 'while';

Do: 'do';

Import: 'import';

Identifier: [a-zA-Z] [a-zA-Z0-9_]*;

Integer: [0-9]+;

LPAREN: '(';
RPAREN: ')';
EQUAL: '=';
PLUS: '+';
MINUS: '-';
MUL: '*';
DIV: '/';
BECOMES: ':=';
DOT: '.';
SEMICOLON: ';';
COLON: ':';
NOTEQUAL: '#';
LT: '<';
GT: '>';
LE: '<=';
GE: '>=';
COMMA: ',';
LBRACKET: '[';
RBRACKET: ']';

String: '"' Schar* '"';

fragment Schar: ~ ["];

LineComment: '//' ~ [\r\n]* -> channel(CM_CHANNEL);

WS: [ \t]+ -> channel(WS_CHANNEL);
NL: ('\r\n' | '\r' | '\n') -> channel(WS_CHANNEL);

UNRECOGNIZED: .;
